package com.victor.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.victor.entity.Picturebook;

@Mapper
public interface PicturebookDao {
	int batchDelete(@Param("ids") int[] ids);

	int insertPicture(Picturebook record);

	Picturebook findById(Integer pId);

	int update(Picturebook record);

	List<Picturebook> batchFindByIds(@Param("pidList") List<String> pidList);

	List<Map<String, String>> statisticsClick(@Param("pictype") String pictype, @Param("cid") String cid,
			@Param("picid") String picid, @Param("btime") String btime, @Param("etime") String etime);

	boolean addClick(@Param("pid") String pid);

	List<Map<String, String>> statisticsBuy(@Param("pictype") String pictype, @Param("cid") String cid,
			@Param("picid") String picid, @Param("btime") String btime, @Param("etime") String etime);

	List<Map<String, String>> batchFindByIdsm(@Param("pidList") List<String> pidList,@Param("userid")String userid);

	@Select("select p_id pId,p_name pName from picturebook where p_type = #{pictype}")
	List<Picturebook> findPicture(@Param("pictype")String pictype);

	//获取没有关联的绘本
	List<Picturebook> findInvalidInfo();


}